#ifndef COLLATTR_H
#define COLLATTR_H

#include <QtSql>
#include <QtGui>
#include <QtXml>
#include "xmlparsedefs.h"
#include "importdefsdialog.h"
#include "ui_collattr.h"

class CollAttr: public QWidget, private Ui::CollAttr
{
Q_OBJECT

public:

CollAttr();
~CollAttr();


public slots:

void delete_models();
void new_nom();
void new_state();
void new_epoch();
void new_mark();
void new_edge();
void new_material();
void new_ms();
void new_type();
void new_undertype();
void new_status();
void new_unit();
void new_curr();
void new_cond();
void new_cert();
void new_loc();
void new_catalog();
void new_obvsymb();
void new_revsymb();
void new_obvtype();
void new_revtype();
void new_auct();
void new_rectype();
void delete_nom();
void delete_state();
void delete_epoch();
void delete_mark();
void delete_edge();
void delete_material();
void delete_ms();
void delete_type();
void delete_undertype();
void delete_status();
void delete_unit();
void delete_curr();
void delete_cond();
void delete_cert();
void delete_loc();
void delete_catalog();
void delete_obvsymb();
void delete_revsymb();
void delete_obvtype();
void delete_revtype();
void delete_auct();
void delete_rectype();
void import_xml_defs();

signals:

void reload_attrs();

private:

QString opened_album;
QString opened_album_num;
QString opened_album_name;
void set_models( QTableView * tView,
                 QString table_string,
                 QString header );
void new_row( QTableView * tView,
              QString table_string,
              QString id_field,
              QString column_name );
QSqlRecord construct_record( QString table_string,
                             QString id_field,
                             QString column_name );
void delete_model(QTableView * tView);
void delete_rows(QTableView * tView);
void writeSettings();
void readSettings();
QMap<QString, QString> definition_field_names;
QMap<QString, QString> definition_id_names;
QMap<QString, QString> definition_tables;
QStringList worksheets;
QList<QTableView *> tableviews;

protected:

void closeEvent(QCloseEvent * e);

};

#endif // COLLATTR_H

